<template>
	<view class="main">
		<view> 【缓存数据】 </view>
		<rich-text nodes="
		    uni.setStorageSync(key,obj)<br/>
			uni.getStorageSync(key);">
		 </rich-text> 
		<view>【封装网络处理】</view>
		<rich-text  nodes="myAjax.ajax({
			<br/>url: '/userCoin/withdrawal',
            <br/>method: 'POST',
			<br/>data: Object.assign({},{ code:1}),
			<br/>success: function(res) { }
 <br/>})"> </rich-text>
        <view>【form表单数据】</view>
 		<rich-text  nodes="  header: {'Content-Type': 'application/x-www-form-urlencoded'},"> </rich-text>
		<view>【文件上传】</view>
		<rich-text  :nodes="upload">  </rich-text>
		
	</view>
	
</template>
 <script>
   import myAjax from '@/common/server.js';
   export default {
            data() {
                return {
                    "upload":`  uni.uploadFile({
					<br/>	url : Myajax.baseUrl + '/fileUpload',
					<br/>	filePath: tempFilePaths,
					<br/>	name: 'name',
					<br/>	header:{token:token},
					<br/>	formData:{fileName:'a.png'},
					<br/>	success: function (uploadFileRes) { 
					<br/>		console.log(data)  
					<br/>	}
					<br/>}); 
					`
                }
            },
			onNavigationBarButtonTap(e) {
				console.log(e)
				uni.navigateTo({
					url:'/pages/webWithSocket/KlineApp'
				})
			},
			onShow() {
				
			},
			onHide() {
				
			},
			onBackPress() {
				
			},
			onInit() {
				
			},
			onLoad(option) {
				
			},
			onPullDownRefresh() {
				
			},
			
     }
 </script>
<style> 
.main{
	padding: 10px;
}
</style>

